<?php
//------------------------------------------------------------------------------
// File              : V_AdminEdit
// Modification       :
//------------------------------------------------------------------------------
// Date(yyyy.mm.dd)   Developer                       Action
//------------------------------------------------------------------------------
// 2007.03.05         Tran Thanh                      Created
//------------------------------------------------------------------------------
?>
<script>
function Check() {
	if (document.f.ho_ten.value.length=="") {
		alert("<?=NAME_NOT_NULL?>");
		document.f.ho_ten.focus();
		return false;
	}
	if (document.f.ten_dang_nhap.value.length=="") {
		alert("<?=NAME_LOGIN_NOT_NULL?>");
		document.f.ten_dang_nhap.focus();
		return false;
	}
	if (document.f.mat_khau.value.length=="") {
		alert("<?=PASSWORD_NOT_NULL?>");
		document.f.mat_khau.focus();
		return false;
	}
	if (document.f.mat_khau_moi.value.length=="") {
		alert("<?=PASWORD_NEW_NOT_NULL?>");
		document.f.mat_khau_moi.focus();
		return false;
	}
	if (document.f.go_lai_mat_khau.value.length=="") {
		alert("<?=COMFIG_PASWORD_NOT_NULL?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
	if (document.f.mat_khau_moi.value.length<6) {
		alert("<?=PASWORD_SIZE?>");
		document.f.mat_khau_moi.focus();
		return false;
	}
	if (document.f.go_lai_mat_khau.value.length<6) {
		alert("<?=PASWORD_COMFIG_SIZE?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
	if (document.f.mat_khau_moi.value!=document.f.go_lai_mat_khau.value) {
		alert("<?=COMFIG_PASWORD_AND_PASSWORD_NOT_SAME?>");
		document.f.go_lai_mat_khau.focus();
		return false;
	}
}
</script>
<script language = 'JavaScript' >
function backToList(){
 	location = '<?="?".MODUL."=admin&".ACTION."="."List"?>';
 	return;
}
</script>
<?php
function V_AdminEdit(&$arrayData,$mode="ChangePass"){	
	$ulr = "?".MODUL."=admin&".ACTION."=".$mode;//htmlspecialchars($_SERVER['QUERY_STRING']);
	//print_r($arrayData);
	?>
	<link href="../../../css/base.css" rel="stylesheet" type="text/css">
	<style type="text/css">
<!--
.style8 {color: #000099; font-size: 12px; }
-->
    </style>
<font size="2" color="#FF0000"><?= CM_showError() ?></font>
<table width="470" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#FF9900" bordercolordark="white">
<form action="<?=$ulr?>" method="post" name="f" id="f" onsubmit="return Check();">
	<input type="hidden" name="id" value="<?=$arrayData["id"]?>" />	<tr>
          <td colspan="2" bgcolor="#FFE59F"  class=bk12-140 > <div align="center"><font color="#000033"><strong>Đổi Mật Khẩu</strong></font></div></td>
        </tr>
        <tr >
          <td width="137" bgcolor="#FFE59F"  class=bk12-140 ><span class="style8">T&ecirc;n</span></td> 
          <td width="315"><input name="ho_ten" type="text" id="ho_ten" value="<?=$arrayData["ho_ten"]?>" size="45" /></td>
        </tr>
        <tr>
          <td bgcolor="#FFE59F"  class=bk12-140 ><span class="style8">T&ecirc;n đ&#259;ng nhập</span></td> 
          <td><input name="ten_dang_nhap" type="text" id="ten_dang_nhap" value="<?=$arrayData["ten_dang_nhap"]?>" size="45" /></td>
        </tr> 
        <tr>
         <td bgcolor="#FFE59F"  class=bk12-140 ><span class="style8">Mật khẩu c&#361;</span></td> 
          <td><input name="mat_khau" type="password" id="mat_khau"   value="" size="45" /></td>  
        </tr>
		<tr>
		  <td bgcolor="#FFE59F"  class=bk12-140 ><span class="style8">Mật kh&#7849;u mới</span></td> 
          <td><input name="mat_khau_moi" type="password" id="mat_khau_moi" value="" size="45" /></td> 
        </tr>
		 <tr>
		   <td bgcolor="#FFE59F"  class=bk12-140 ><span class="style8">Nhập lại mật khẩu</span></td> 
           <td><input name="go_lai_mat_khau" type="password" id="go_lai_mat_khau" value="" size="45" />
		</td>  
        </tr>
        <tr>
          <td colspan="2"><div align="center">
	        <input name="Reset" class="input_btn" type="reset" value="  Nhập lại  " />
	        <input name="Submit" class="input_btn" type="submit" value="   Ghi lại  ">
	        <input name="boqua" class="input_btn" type="reset" id="boqua" value="  Trở lại  " onClick="javascript: return backToList();">
          </div></td> 
        </tr>
    </form>
</table>
<?php
}
?>
